#!/bin/bash
/etc/init.d/mongodb stop
/etc/init.d/mysql restart

cd /data/www/htdocs/oblank/scripts/
echo "start test mysql \n"
//1000 times 1 concur
/usr/sbin/ab2 -n 1000 -c 1 'http://10.7.124.23/oblank/scripts/read_mysql.php?db=oblank&table=t10w&concur=1&total=1000'
/usr/sbin/ab2 -n 1000 -c 1 'http://10.7.124.23/oblank/scripts/read_mysql.php?db=oblank&table=t100w&concur=1&total=1000'
/usr/sbin/ab2 -n 1000 -c 1 'http://10.7.124.23/oblank/scripts/read_mysql.php?db=oblank&table=t1000w&concur=1&total=1000'

//5000 times concur
/usr/sbin/ab2 -n 5000 -c 1 'http://10.7.124.23/oblank/scripts/read_mysql.php?db=oblank&table=t10w&concur=1&total=5000'
/usr/sbin/ab2 -n 5000 -c 1 'http://10.7.124.23/oblank/scripts/read_mysql.php?db=oblank&table=t100w&concur=1&total=5000'
/usr/sbin/ab2 -n 5000 -c 1 'http://10.7.124.23/oblank/scripts/read_mysql.php?db=oblank&table=t1000w&concur=1&total=5000'

//10000 times concur
/usr/sbin/ab2 -n 10000 -c 1 'http://10.7.124.23/oblank/scripts/read_mysql.php?db=oblank&table=t10w&concur=1&total=10000'
/usr/sbin/ab2 -n 10000 -c 1 'http://10.7.124.23/oblank/scripts/read_mysql.php?db=oblank&table=t100w&concur=1&total=10000'
/usr/sbin/ab2 -n 10000 -c 1 'http://10.7.124.23/oblank/scripts/read_mysql.php?db=oblank&table=t1000w&concur=1&total=10000'


//indexed nid
//1000 times 1 concur
/usr/sbin/ab2 -n 1000 -c 10 'http://10.7.124.23/oblank/scripts/read_mysql.php?db=oblank_index&table=t10w&concur=10&total=1000'
/usr/sbin/ab2 -n 1000 -c 10 'http://10.7.124.23/oblank/scripts/read_mysql.php?db=oblank_index&table=t100w&concur=10&total=1000'
/usr/sbin/ab2 -n 1000 -c 10 'http://10.7.124.23/oblank/scripts/read_mysql.php?db=oblank_index&table=t1000w&concur=10&total=1000'

//5000 times concur
/usr/sbin/ab2 -n 5000 -c 10 'http://10.7.124.23/oblank/scripts/read_mysql.php?db=oblank_index&table=t10w&concur=10&total=5000'
/usr/sbin/ab2 -n 5000 -c 10 'http://10.7.124.23/oblank/scripts/read_mysql.php?db=oblank_index&table=t100w&concur=10&total=5000'
/usr/sbin/ab2 -n 5000 -c 10 'http://10.7.124.23/oblank/scripts/read_mysql.php?db=oblank_index&table=t1000w&concur=10&total=5000'

//10000 times concur
/usr/sbin/ab2 -n 10000 -c 10 'http://10.7.124.23/oblank/scripts/read_mysql.php?db=oblank_index&table=t10w&concur=10&total=10000'
/usr/sbin/ab2 -n 10000 -c 10 'http://10.7.124.23/oblank/scripts/read_mysql.php?db=oblank_index&table=t100w&concur=10&total=10000'
/usr/sbin/ab2 -n 10000 -c 10 'http://10.7.124.23/oblank/scripts/read_mysql.php?db=oblank_index&table=t1000w&concur=10&total=10000'


/etc/init.d/mysql stop
/etc/init.d/mongodb start

echo "mongo test"
//1000 times 1 concur
/usr/sbin/ab2 -n 1000 -c 1 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank&table=t10w&concur=1&total=1000'
/usr/sbin/ab2 -n 1000 -c 1 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank&table=t100w&concur=1&total=1000'
/usr/sbin/ab2 -n 1000 -c 1 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank&table=t1000w&concur=1&total=1000'

//5000 times concur
/usr/sbin/ab2 -n 5000 -c 1 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank&table=t10w&concur=1&total=5000'
/usr/sbin/ab2 -n 5000 -c 1 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank&table=t100w&concur=1&total=5000'
/usr/sbin/ab2 -n 5000 -c 1 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank&table=t1000w&concur=1&total=5000'

//10000 times concur
/usr/sbin/ab2 -n 10000 -c 1 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank&table=t10w&concur=1&total=10000'
/usr/sbin/ab2 -n 10000 -c 1 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank&table=t100w&concur=1&total=10000'
/usr/sbin/ab2 -n 10000 -c 1 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank&table=t1000w&concur=1&total=10000'


//1000 times 1 concur not indexed
/usr/sbin/ab2 -n 20 -c 10 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank&table=t10w&concur=10&total=1000'
/usr/sbin/ab2 -n 20 -c 10 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank&table=t100w&concur=10&total=1000'
/usr/sbin/ab2 -n 20 -c 10 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank&table=t1000w&concur=10&total=1000'

//5000 times concur
/usr/sbin/ab2 -n 50 -c 10 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank&table=t10w&concur=10&total=5000'
/usr/sbin/ab2 -n 50 -c 10 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank&table=t100w&concur=10&total=5000'
/usr/sbin/ab2 -n 50 -c 10 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank&table=t1000w&concur=10&total=5000'

//10000 times concur
/usr/sbin/ab2 -n 100 -c 10 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank&table=t10w&concur=10&total=10000'
/usr/sbin/ab2 -n 100 -c 10 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank&table=t100w&concur=10&total=10000'
/usr/sbin/ab2 -n 100 -c 10 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank&table=t1000w&concur=10&total=10000'

//1000 times 1 concur indexed
/usr/sbin/ab2 -n 1000 -c 1 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank_index&table=t10w&concur=1&total=1000'
/usr/sbin/ab2 -n 1000 -c 1 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank_index&table=t100w&concur=1&total=1000'
/usr/sbin/ab2 -n 1000 -c 1 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank_index&table=t1000w&concur=1&total=1000'

//5000 times concur
/usr/sbin/ab2 -n 5000 -c 1 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank_index&table=t10w&concur=1&total=5000'
/usr/sbin/ab2 -n 5000 -c 1 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank_index&table=t100w&concur=1&total=5000'
/usr/sbin/ab2 -n 5000 -c 1 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank_index&table=t1000w&concur=1&total=5000'

//10000 times concur
/usr/sbin/ab2 -n 10000 -c 1 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank_index&table=t10w&concur=1&total=10000'
/usr/sbin/ab2 -n 10000 -c 1 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank_index&table=t100w&concur=1&total=10000'
/usr/sbin/ab2 -n 10000 -c 1 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank_index&table=t1000w&concur=1&total=10000'

//indexed nid
//1000 times 1 concur
/usr/sbin/ab2 -n 1000 -c 10 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank_index&table=t10w&concur=10&total=1000'
/usr/sbin/ab2 -n 1000 -c 10 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank_index&table=t100w&concur=10&total=1000'
/usr/sbin/ab2 -n 1000 -c 10 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank_index&table=t1000w&concur=10&total=1000'

//5000 times concur
/usr/sbin/ab2 -n 5000 -c 10 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank_index&table=t10w&concur=10&total=5000'
/usr/sbin/ab2 -n 5000 -c 10 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank_index&table=t100w&concur=10&total=5000'
/usr/sbin/ab2 -n 5000 -c 10 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank_index&table=t1000w&concur=10&total=5000'

//10000 times concur
/usr/sbin/ab2 -n 10000 -c 10 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank_index&table=t10w&concur=10&total=10000'
/usr/sbin/ab2 -n 10000 -c 10 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank_index&table=t100w&concur=10&total=10000'
/usr/sbin/ab2 -n 10000 -c 10 'http://10.7.124.23/oblank/scripts/read_mongo.php?db=oblank_index&table=t1000w&concur=10&total=10000'

/etc/init.d/mysql start
/etc/init.d/mongodb restart

mv cpu_mem_monitor.sh cpu_mem_monitor.sh.bak

curl 'http://csis.cm.com/services/rest/MessageService/send_sms/xml?number=13541277256&content=successs&direct=1&__login=CSIS&__password=tencent123'